The user will press the Space Bar to shoot the ball at the trajectory set by pressing the Left and Down Arrow Keys.

  • From , drag Space Bar to the bottom of your program. Delete the .jump() command.
  • Go to and drag Sprite Gravity On for the ball.
  • Use Set x Speed to set the horizontal speed of the ball to the value of left_count.
  • Use Set y Speed to set the ball's vertical speed to the value of down_count.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)